package Facada_Pattern.computer;

// -*-coding:utf-8 -*-
//人员：刘陆鑫
//班级：19软3
//学号；2019110218
public class Mainframe {
    private Memory memory;
    private CPU cpu;
    private HardDisk hardDisk;
    private OS os;
    public Mainframe(){
        memory=new Memory();
        cpu=new CPU();
        hardDisk=new HardDisk();
        os=new OS();
    }
    public void on(){
        if(memory.check()&&cpu.run()&&hardDisk.read()&&os.load()){
            System.out.println("电脑启动成功");
        }
        else{
            System.out.println("电脑启动失败");
        }
    }
}
